package www.wen.com.common.lib.view.popuview

import android.content.Context
import android.view.View
import com.lxj.xpopup.core.AttachPopupView
import com.lxj.xpopup.util.XPopupUtils
import www.wen.com.common.R
import www.wen.com.common.lib.extension.setOnClickListenerAgency
import www.wen.com.common.lib.helper.UiCallBack

/**
 * @author WEN
 * @Description:
 * @date 2021/9/15 15:48
 */
class ServerMenuPopupView(context: Context,
                          val uiCallBack: UiCallBack) : AttachPopupView(context), View.OnClickListener {

    private lateinit var llAddFriend: View

    private lateinit var llCreateServer: View

    private lateinit var llJoinServer: View

    override fun onCreate() {
        super.onCreate()
        llAddFriend = findViewById(R.id.llAddFriend)
        llCreateServer = findViewById(R.id.llCreateServer)
        llJoinServer = findViewById(R.id.llJoinServer)
        setOnClickListenerAgency(this, llAddFriend, llCreateServer, llJoinServer)
    }

    override fun initPopupContent() {
        super.initPopupContent()
        attachPopupContainer.background = XPopupUtils.createDrawable(android.R.color.transparent,5f)
    }

    override fun getImplLayoutId(): Int = R.layout.popupview_server_menu

    override fun onClick(v: View) {
        uiCallBack(v, this)
    }


}
